Motion-compensated interframe prediction coding has been known as a coding system for moving image data. In the motion-compensated interframe prediction coding, motion vector representing the “motion” of a picture element between frames is detected in an encoder. Using the detected motion vector, the image of a current frame is predicted from a past frame (or, from both of a past frame and a future frame), and the difference (that is, error) between the current image and the predicted image is detected. Then, the motion vector information and the prediction error information are transmitted. A decoder reproduces a moving image using the motion vector information and the prediction error information.
Once an error which corrupts the transmitted date occurs in the motion-compensated interframe prediction coding, the error is propagated to subsequent frames. For this reason, in the motion-compensated interframe prediction coding, usually, an intraframe-coded picture is periodically inserted. The intraframe-coded picture is encoded independently from other frames. Therefore, even if an error occurs, the error is not propagated to the subsequent frames of the intraframe-coded picture.
However, the information amount of the intraframe-coded picture is significantly larger than that of an interframe-coded picture. Therefore, the periodical insertion of the intraframe-coded picture raises the peak value of traffic. In order to secure the traffic, the buffer size needs to be increased.
As a technique for solving the problem, a coding system called sequential refresh has been proposed. The sequential refresh is explained with reference to FIG. 1. Here, “refresh” means to perform the intraframe coding. In the following explanation, each frame is assumed to have four areas 501-504.
As illustrated in FIG. 1, in a frame n, the image in the area 501 is encoded by the intraframe coding, and the images in the areas 502-504 are encoded by the interframe coding. Next, in a frame n+1, the image in the area 502 is encoded by the intraframe coding, and the images in the areas 501, 503, 504 are encoded by the interframe coding. In a similar manner, in a frame n+2, the image in the area 503 is encoded by the intraframe coding, and in a frame n+3, the image in the area 504 is encoded by the intraframe coding. Thus, in the example illustrated in FIG. 1, all areas are refreshed in a cycle of four frames. The sequential refresh is described in, for example, Japanese Laid-open Patent Publication No. 2003-179938, Japanese Laid-open Patent Publication No. 6-113286 and Japanese Laid-open Patent Publication No. 2005-260936.
Meanwhile, in the motion-compensated interframe coding adopting the sequential refresh, in order to suppress the propagation of an error, or to provide a “cue play function”, the reference area for the motion compensation needs to be restricted. Hereinafter, referring to FIG. 2-FIG. 4, the restriction of the reference area is explained. In FIG. 2-FIG. 4, in the same manner as in FIG. 1, it is assumed that the areas 501, 502, 503, 504 are refreshed sequentially in the frame n, the frame n+1, the frame n+2, the frame n+3, respectively. In this case, in the frame n, the refresh is not finished in the areas 502-504. That is, the areas 502-504 are refresh-unfinished area. In the frame n+1, the refresh of the area 501 has been finished, while the refresh of the areas 503-504 is unfinished. In a similar manner, in the frame n+2, the areas 501-502 are the refresh-finished area, and the area 504 is the refresh-unfinished area. In the frame n+3, the areas 501-503 are the refresh-finished area.
When encoding an image by the interframe coding, for example, an image in the preceding frame is used as reference. When encoding an image in the refresh-unfinished area, an image in any area in the frame may be used as reference. Therefore, in FIG. 2, references 511, 512 are allowed. However, in order to suppress the propagation of an error, an image in the refresh-unfinished area may not be used as reference, when encoding an image in the refresh-finished area. Therefore, in FIG. 2, references 513, 514 are allowed, while a reference 515 is not allowed.
In addition, in order to provide a “cue play function”, an image in the refresh-unfinished area cannot be used as reference, when encoding an image in the refresh-finished area. For example, in the example illustrated in FIG. 3, images in the refresh area or in the refresh-finished area are used as reference (references 521-523). Therefore, in this case, the playback of a moving image can be started from the frame n+3. In contrast, in the example illustrated in FIG. 4, an image in the refresh-unfinished area is used as reference (a reference 524), when encoding an image in the refresh-finished area. In this case, since the frame n+1 cannot be decoded, the frame n+2 and the frame n+3 also cannot be played back, as a result. Therefore, the playback of the moving image cannot be started from the frame n+3.
FIG. 5 describes a problem of the sequential refresh. Here, it is assumed that an image in a block A in the frame n+1 is encoded referring to an image of the frame n. It is also assumed that a block B and a block C are detected as candidates of reference images for the block A. The block B does not include any image of the refresh-unfinished area. On the other hand, the block C includes an image of the refresh-unfinished area.
Under such conditions, the propagation of an error is suppressed by prohibiting the reference to the block C. However, when the block C is preferable to the block B as reference image for the motion compensation of the block A, if coding/decoding is performed using the image in the block B, it causes the degradation of the image.
Thus, with the conventional motion-compensated interframe prediction coding, there has been a risk of causing the degradation of the image when adopting the sequential refresh. In other words, with the conventional motion-compensated interframe prediction coding, it has been difficult to realize the suppression of the peak of the information amount with good image quality.